<script type="text/javascript">
    $(function () {
        //公司
        $("#toolbar_cgwjsje_search [name='cgwjsje_gs']").gsjgtree(1);
        //搜索按钮
        $("#toolbar_cgwjsje_search [name='btn_cgwjsje_search_init']").click(function () {
            $(grid).datagrid({
                queryParams:{
                    gsid:$("#toolbar_cgwjsje_search [name='cgwjsje_gs']").val(),
                    enddt:$("#toolbar_cgwjsje_search [name='cgwjsjeEndDate']").val(),
                    custname:$("#toolbar_cgwjsje_search [name='cgwjsjeGys']").val()

                }});
        });

        var columns = [
            [
                {field:'GS_NAME', title:'公司本部', width:145, align:'center'},
                {field:'CGDH', title:'采购单号', width:250, align:'center'},
                {field:'RKSJ', title:'入库时间', width:145, align:'center'},
                {field:'WZBH', title:'物资编号', width:145, align:'right'},
                {field:'PM', title:'品名', width:145, align:'right'},
                {field:'GGXH', title:'规格型号', width:145, align:'right'},
                {field:'SL', title:'数量', width:145, formatter:function (v, r, i) {
                    return formatSl(v, ",", ".");
                }, align:'right'},
                {field:'DJ', title:'单价', width:145, formatter:function (v, r, i) {
                    return formatSl(v, ",", ".");
                }, align:'right'},
                {field:'JE', title:'金额', align:'right', formatter:function (v, r, i) {
                    return formatSl2(v, ",", ".");
                }, width:145},
                {field:'CUST_NAME', title:'单位名称', width:145, align:'right'}
            ]
        ];

        var grid = $('#cgwjsje_into_grid').datagrid({
            url:$.webPath() + '/tjbb/gyswl/cgwjsjelist',
            toolbar:"#toolbar_cgwjsje_search",
            //pagination:true,
            rownumbers:true,
            singleSelect:true,
            collapsible:true,
            fit:true,
            fitColumns:true,
            pageNumber:1,
            showFooter:true,
            queryParams:{
                gsid:$("#toolbar_cgwjsje_search [name='cgwjsje_gs']").val(),
                enddt:$("#toolbar_cgwjsje_search [name='cgwjsjeEndDate']").val(),
                custname:$("#toolbar_cgwjsje_search [name='cgwjsjeGys']").val()

            },
            columns:columns
        });

    })

</script>
<div class="easyui-layout" data-options="fit:true" style="width: 100%;height: 100%">

    <div data-options="region:'center'">
        <div id="toolbar_cgwjsje_search">
            <div class="textcon">
                <table class="tb" style="margin-left: 12px;">
                    <tr>
                        <th>公司：</th>
                        <td><input name="cgwjsje_gs" type="text" class="searchinput-text" value="${(gsid)!}"/>
                        </td>
                        <th>截止时间：</th>
                        <td>
                            <input id="cgwjsje_endDate" name="cgwjsjeEndDate" type="text" class="easyui-datebox"
                                   value="${(enddt?date)!}" style="width:152px"/>
                        </td>
                        <th>供应商：</th>
                        <td><input name="cgwjsjeGys" type="text" class="input-text" value="${(custname)!}"/>
                            <input name="btn_cgwjsje_search_init" type="button" value=""
                                   class="submit"/>  </td>
                    </tr>
                </table>
            </div>
        </div>
        <table id="cgwjsje_into_grid"></table>
    </div>
</div>